package com.gblfy.ws.servlet;

import org.codehaus.xfire.spring.XFireSpringServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置xfire访问的Servlet
 *
 * @author gblfy
 * @date 2021-09-17
 */
@Configuration
public class XfireBootServlet {
    private final static Logger log = LoggerFactory.getLogger(XfireBootServlet.class);

    @Bean
    public ServletRegistrationBean registrationBean() {
        log.info("xfire 初始化bean start . . . ");
        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean();
        servletRegistrationBean.setServlet(new XFireSpringServlet());
        servletRegistrationBean.addUrlMappings("/xfire/*");
        return servletRegistrationBean;
    }

}
